package com.itheima.myenum;

public class EnumDemo {
    public static void main(String[] args) {

        //通过字符串,获取指定枚举对象    -- static <T> valueof(Class<T> type, String name)
        Season spring = Enum.valueOf(Season.class, "SPRING");
        System.out.println(spring);
        System.out.println(Season.SPRING == spring);

        System.out.println("============================================");
        //获取枚举常量的名称     -- String toString()
        String s = Season.SPRING.toString();
        System.out.println(s);

        System.out.println("============================================");

    }
}
